class CreateSteps < ActiveRecord::Migration
    def self.up
        create_table :steps, :force => true do |t|
            t.column :title, :string
            t.column :path_id, :integer
            t.column :link_id, :integer
            t.column :sequence, :integer
            t.column :created_at, :datetime
            t.column :updated_at, :datetime
        end
        
        execute "ALTER TABLE steps ADD CONSTRAINT paths_steps_path_id_fkey FOREIGN KEY (path_id) REFERENCES paths (id) ON DELETE CASCADE ON UPDATE CASCADE"

    end
    
    def self.down
        drop_table :steps
    end
end
